package main.core;

public class Item {
	private String m_name;
	private float m_minimum_price;
	private float m_maximum_price;
	private float m_current_price;
	
	//Getters
	public String name()
	{
		return this.m_name;
	}
	
	public float maximum_price()
	{
		return this.m_maximum_price;
	}
	
	public float minimum_price()
	{
		return this.m_minimum_price;
	}
	
	public float current_price()
	{
		return this.m_current_price;
	}
	
	//Setters
	public void setName(String name)
	{
		this.m_name = name;
	}
	
	public void setMaximum_price(String maximum_price)
	{
		setMaximum_price(Float.parseFloat(maximum_price));
	}
	
	public void setMaximum_price(float maximum_price)
	{
		this.m_maximum_price = maximum_price;
	}
	
	public void setMinimum_price(String minimum_price)
	{
		setMinimum_price(Float.parseFloat(minimum_price));
	}
	
	public void setMinimum_price(float minimum_price)
	{
		this.m_minimum_price = minimum_price;
	}
	
	public void setCurrent_price(String current_price)
	{
		setCurrent_price(Float.parseFloat(current_price));
	}
	
	public void setCurrent_price(float current_price)
	{
		if(current_price > this.m_maximum_price)
			this.m_current_price = this.m_maximum_price;
		else if(current_price < m_minimum_price)
			this.m_current_price = this.m_minimum_price;
		else
			this.m_current_price = current_price;
	}
}
